package com.dd.cloud.user.DTO.tencent;

import lombok.Data;

/**
 * @Description: im即時通信接口返回
 * @Author: czg
 * @Date: 2023/7/7 9:53
 * @Version: 1.0.0
 */
@Data
public class ImCallbackRes {

    /**
     * 请求处理的结果，OK 表示处理成功，FAIL 表示失败
     */
    private String ActionStatus;

    /**
     * 错误码，0为回调成功；1为回调出错
     */
    private Integer ErrorCode;

    /**
     * 错误信息
     */
    private String ErrorInfo;

    public static ImCallbackRes ok(){
        ImCallbackRes res = new ImCallbackRes();
        res.ActionStatus = "OK";
        res.setErrorCode(0);
        res.setErrorInfo(null);
        return res;
    }

    public static ImCallbackRes fail(String msg){
        ImCallbackRes res = new ImCallbackRes();
        res.ActionStatus = "FAIL";
        res.setErrorCode(1);
        res.setErrorInfo(msg);
        return res;
    }

}
